#include <bits/stdc++.h>

using namespace std;
const int maxn=81;
int main_1084()
{
    char origion_str[maxn];
    char type_out_str[maxn];
    scanf("%s%s",origion_str,type_out_str);
    unordered_map<char,int> isExist;
    int len1=strlen(type_out_str),len2=strlen(origion_str);
    for (int i=0; i<len1; ++i )
    {
        isExist[toupper(type_out_str[i])]=1;
    }
    char c;
    for (int j=0; j<len2; ++j )
    {
        c=toupper(origion_str[j]);
        if (isExist.find(c)==isExist.end())
        {
            printf("%c",c);
            isExist[c]=1;
        }
    }
    return 0;
}
